package com.test.practice.enumTest;


/**
 * PositionEnum--职级
 *
 * @author: Jovi
 * @createTime: 2017-06-12 16:36
 **/
public enum PositionEnum {

    Person_In_Charge("C01"),
    Senior_Manager("C01"),
    Middle_Manager("C02"),
    Junior_Manager("C03"),
    Staff("C04"),
    Out_Sourcing("C06"),
    Parttime_Staff("C05"),
    Retire("C26"),
    ;

    private String code;

    public String getCode() {
        return code;
    }

    PositionEnum(String code) {
        this.code = code;
    }

    public static String getCodeByName(String key) {

        for (PositionEnum r : PositionEnum.values()) {
            if (r.name().equals(key)) {
                return r.getCode();
            }
        }
        return null;
    }

    @Override
    public String toString() {
        return "WorkflowNodeEnum{" +
                "code='" + code + '\'' +
                '}';
    }
}
